package com.ptp.backendcertms.business.handler;

import com.ptp.backendcertms.api.external.dto.res.PageInfoDto;
import org.springframework.stereotype.Component;

/**
 * 分页构造器公共实现
 */
@Component
public class PageInfoCommonHandler {

    /**
     * 构造分页对象
     */
    public PageInfoDto buildPageInfo(Long total, Integer current, Integer pageSize) {
        PageInfoDto pageInfoDto = new PageInfoDto();
        pageInfoDto.setTotal(total);
        pageInfoDto.setCurrent(current);
        pageInfoDto.setPageSize(pageSize);
        return pageInfoDto;
    }
}
